﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="author" content="ISUX">
    <meta name="format-detection" content="telephone=no" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
    <title>缴费页面</title>
    <link rel="stylesheet" href="/ViewMob/css/wxui.css">
    <link rel="stylesheet" href="/ViewMob/css/default.css">

    <link href="//at.alicdn.com/t/font_381216_amtfd8zumzd26gvi.css" rel="stylesheet" />
    <link href="/ViewMob/js/layer/need/layer.css" rel="stylesheet" />
    <script src="/ViewMob/js/layer/layer.m.js"></script>
    <style>
        .ms-controller, [ms-controller] {
            display: none;
        }

        .page {
            overflow-y: auto;
            -webkit-overflow-scrolling: touch;
            opacity: 0;
            z-index: 1;
        }

            .page.js_show {
                opacity: 1;
            }

        .page__hd {
            padding: 24px;
            text-align: center;
            background: #4faeff url(../images/bg-account.jpg) 100% 100%;
            color: white;
        }

        .page__bd_spacing {
            padding: 0 15px;
        }

        .page__ft {
            padding-top: 40px;
            padding-bottom: 10px;
            text-align: center;
        }

            .page__ft img {
                height: 19px;
            }

            .page__ft.j_bottom {
                position: absolute;
                bottom: 0;
                left: 0;
                right: 0;
            }

        .page__title {
            text-align: left;
            font-size: 20px;
            font-weight: 400;
        }

        .page__desc {
            margin-top: 5px;
            text-align: left;
            font-size: 14px;
        }

        .page.home .page__intro-icon {
            margin-top: -.2em;
            margin-left: 5px;
            width: 16px;
            height: 16px;
            vertical-align: middle;
        }

        .page.home .page__title {
            font-size: 0;
            margin-bottom: 15px;
        }


        .head-oneself {
            width: 4.5rem;
            height: 4.5rem;
            margin-left: 20px;
        }

            .head-oneself img {
                border: 2px solid rgba(0,0,0,.2);
            }

        .ybl {
            background-color: #10c55b;
            font-size: 30px;
            color: white;
        }

        .kx {
            background-color: #10c55b;
        }

        .wbl {
            background-color: lightgray;
            font-size: 20px;
            color: white;
        }

        .list-chart {
            background: #fff;
            margin-bottom: 5px;
            overflow: hidden;
        }

            .list-chart dd {
                float: left;
                width: 25%;
                padding: 5px 0;
                text-align: center;
                font-size: 13px;
            }



        .sel {
            background: #f5eeee;
        }
    </style>
</head>
<body style="background-color: #f8f8f8;" ms-controller="PAGE">
    <div class="page__hd">
        <h1 class="page__title">校友回馈</h1>
        <p class="page__desc">微信自助缴费平台</p>
    </div>
    <div class="page__bd">
        <div class="weui-form-preview">
            <div class="weui-form-preview__hd">
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">付款金额</label>
                    <em class="weui-form-preview__value">¥2400.00</em>
                </div>
            </div>
            <div class="weui-form-preview__bd">
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">项目</label>
                    <span class="weui-form-preview__value">CET-4</span>
                </div>
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">发起人</label>
                    <span class="weui-form-preview__value">英语等级考试</span>
                </div>
                <div class="weui-form-preview__item">
                    <label class="weui-form-preview__label">缴费用户</label>
                    <span class="weui-form-preview__value">张三丰</span>
                </div>
            </div>
            <div class="weui-form-preview__ft">
                <a class="weui-form-preview__btn weui-form-preview__btn_primary" href="javascript:" ms-click="gopay()">点击缴费</a>
            </div>
        </div>
        <br>
    </div>



    <script src="/ViewMob/js/zepto.min.js"></script>
    <script src="/ViewMob/js/weui.min.js"></script>
    <script src="/ViewMob/js/avalon1.47.js"></script>
    <script src="/ViewMob/js/ComFunJS.js"></script>

    <script type="text/javascript" class="searchbar js_show">
        var model = avalon.define({
            $id: "PAGE",
            OrderID: ComFunJS.getQueryString("orderid"),
            code: ComFunJS.getQueryString("code"),
            jsapi: "",
            orderInfoData: {},
            json: {},
            gopay: function () {
                $.getJSON("/API/VIEWAPI.ashx?Action=CX_WXZF&r=" + Math.random(), { code: model.code, orderid: model.OrderID }, function (r) {
                    if (r.ErrorMsg == "") {
                        model.json = r.Result;
                        if (typeof WeixinJSBridge == "undefined") {
                            if (document.addEventListener) {
                                document.addEventListener('WeixinJSBridgeReady', jsApiCall, false);
                            } else if (document.attachEvent) {
                                document.attachEvent('WeixinJSBridgeReady', jsApiCall);
                                document.attachEvent('onWeixinJSBridgeReady', jsApiCall);
                            }
                        } else {
                            jsApiCall();
                        }
                    } else {
                        alert(r.ErrorMsg)
                    }
                })
            },
            tiaozhang: function () {
                window.location = "UI_SUCCESS.html";
            }
        })
        avalon.ready(function () {
         
        })
        function jsApiCall() {
            WeixinJSBridge.invoke('getBrandWCPayRequest', model.json, function (res) {
                if (res.err_msg == "get_brand_wcpay_request:ok") {
                    model.tiaozhang();
                } else {
                    alert("支付订单失败1111");
                }
                // 使用以上方式判断前端返回,微信团队郑重提示：res.err_msg将在用户支付成功后返回ok，但并不保证它绝对可靠。
            });
        }
    </script>
</body>
</html>
